package org.headquarter.gui;

import org.apache.log4j.PropertyConfigurator;
import org.boxlayout.gui.BoxLayoutEngine;
import org.boxlayout.gui.BoxLayoutFrame;
import org.boxlayout.widget.TextCursorManager;
import org.headquarter.object.Node;

public class Viewer {

    
    public Viewer(Node place){
	//PropertyConfigurator.configure("log4j.properties");
	BoxLayoutFrame blf  = new BoxLayoutFrame();
	BoxLayoutEngine ble = blf.getBoxLayoutEngine();
	//ble.setOrtho(true);
	Float[] body = {2f,-2f,5f};
	Float[] target = {2f,-2f,0f};
	ble.getCamera().setBodyPosition(body);
	ble.getCamera().setTargetPosition(target);
	//VisualElement ve = ble.createElement();
	WidgetPlace visualPlace = new WidgetPlace(ble);
	visualPlace.loadNode(place);
	ble.setRootElement(visualPlace.getVisual());
	
	TextCursorManager.getInstance().init(ble);
    }
    
  
}
